package com.gulimall.common.constrant;

import lombok.Getter;

/**
 * @author kkk
 * @date 2022/7/18
 */
public class WareConstant {
    @Getter
    public enum PurchaseStatusEnum {
        /**
         * 新建
         */
        CREATED(0, "新建"),
        /**
         * 已分配
         */
        ASSIGNED(1, "已分配"),
        /**
         * 正在采购
         */
        PURCHASING(2, "正在采购"),
        /**
         * 已完成
         */
        COMPLETED(3, "已完成"),
        /**
         * 采购失败
         */
        FAILED(4, "采购失败");
        private int code;
        private String msg;

        PurchaseStatusEnum(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }
    }

    @Getter
    public enum PurchaseDetailStatusEnum {

        /**
         * 新建
         */
        CREATED(0, "新建"),
        /**
         * 已分配
         */
        ASSIGNED(1, "已分配"),
        /**
         * 已领取
         */
        RECEIVED(2, "已领取"),
        /**
         * 已完成
         */
        COMPLETED(3, "已完成"),
        /**
         * 有异常
         */
        EXCEPTION(4, "有异常");
        private int code;
        private String msg;

        PurchaseDetailStatusEnum(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }
    }

    @Getter
    public enum WareLockStatus {

        /**
         * 新建
         */
        LOCK(1, "锁定"),
        /**
         * 解锁
         */
        ASSIGNED(2, "解锁"),
        /**
         * 扣减
         */
        RECEIVED(3, "扣减");
        private final int code;
        private final String msg;

        WareLockStatus(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }
    }

    public static final String WARE_STOCK_LOCKED_KEY = "stock.locked";
    public static final String WARE_STOCK_EVENT_EXCHANGE = "stock-event-exchange";
    public static final String WARE_STOCK_DELAY_QUEUE = "stock_delay_queue";
    public static final String WARE_STOCK_RELEASE_QUEUE = "stock.release.stock.queue";
    public static final String WARE_STOCK_RELEASE_KEY = "stock.release";
    public static final Long TTL_TIME = 60000L;

}
